/*
 * Motor.h
 *
 *  Created on: 2025Äê9ÔÂ12ÈÕ
 *      Author: Move
 */

#ifndef CODE_MOTOR_H_
#define CODE_MOTOR_H_

#include "zf_common_headfile.h"
#include "Pid.h"

extern PID_T Speed_L, Speed_R , Angle;
extern int16 ENCO_Wish_L;
extern int16 ENCO_Wish_R;
extern int16 Basic_Speed;

#define Servo_Pin       (ATOM1_CH2_P21_4)
extern float Servo_Middle;
extern float Servo_Max;
extern float Servo_Min;

#define Motor_R_Dir         (P02_5)
#define Motor_R_Pwm         (ATOM0_CH7_P02_7)

#define Motor_L_Dir         (P02_4)
#define Motor_L_Pwm         (ATOM0_CH6_P02_6)

void PID_Params_Init(void);
void Servo_Init(void);
void Motor_Init(void);
void Motor_PWM(int Speed_L , int Speed_R);
void Motor_PID(void);
void Servo_Control(void);
void speed_diff(void);
void PID_Init(void);


#endif /* CODE_MOTOR_H_ */
